home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / kernel / Include / sun3.md / machEeprom.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-13  |  10.9 KB  |  312 lines

  1. /*
  2.  * machEeprom.h --
  3.  *
  4.  * This is based on "eeprom.h", 1.18 88/02/08 SMI
  5.  * Copyright (c) 1986, 1987 Sun Microsystems, Inc.
  6.  *
  7.  * This defines the format of the EEPROM on the Sun-3.
  8.  * A pointer to the EEPROM is defined as "machEepromPtr",
  9.  * and the format of the EEPROM is defined by struct Mach_Eeprom
  10.  */
  11.  
  12. #ifndef _MACHEEPROM_
  13. #define _MACHEEPROM_
  14.  
  15. /*
  16.  * Generic descriptors.  These are returned from Mach_EepromGetConfig().
  17.  */
  18. typedef struct Mach_CpuConfig {
  19.     int type;
  20. } Mach_CpuConfig;
  21.  
  22. typedef struct Mach_ColorConfig {
  23.     int valid;        /* 1 if color board exists */
  24.     int type;        /* Color board types defined below */
  25.     unsigned int firstPage;    /* First page of memory to reserve */
  26.     unsigned int lastPage;    /* Last page */
  27. } Mach_ColorConfig;
  28.  
  29. typedef struct Mach_FpuConfig {
  30.     int valid;        /* 1 if FPU board exists */
  31. } Mach_FpuConfig;
  32.  
  33. typedef unsigned char u_char;
  34. typedef unsigned int u_int;
  35. typedef unsigned short u_short;
  36. typedef int time_t;
  37.  
  38. /*
  39.  * The location of the EEPROM in kernel virtual space.
  40.  */
  41. #define MACH_EEPROM_BASE    0x0fe04000
  42.  
  43. struct keymap {
  44.     unsigned char    keymap[128];
  45. };
  46.  
  47. /*
  48.  * MACH_MAX_SLOTS    Number of slots in the backplane.  Each slot has
  49.  *            configuration information in the EEPROM.
  50.  * MACH_CONFIG_BYTES    Size of the configuration information for each slot.
  51.  */
  52. #define MACH_MAX_SLOTS        12
  53. #define MACH_CONFIG_BYTES    16
  54.  
  55. struct    Mach_Eeprom {
  56.     struct    ee_diag {        /* diagnostic's area of EEPROM */
  57. /* 0x000 */    u_int    eed_test;    /* diagnostic test write area */
  58. /* 0x004 */    u_short    eed_wrcnt[3];    /* diag area write count (3 copies) */
  59.         short    eed_nu1;    /* not used */
  60.  
  61. /* 0x00c */    u_char    eed_chksum[3];    /* diag area checksum (3 copies) */
  62.         char    eed_nu2;    /* not used */
  63. /* 0x010 */    time_t    eed_hwupdate;    /* date of last hardware update */
  64.  
  65. /* 0x014 */    char    eed_memsize;    /* MB's of memory in system */
  66. /* 0x015 */    char    eed_memtest;    /* MB's of memory to test on powerup */
  67.  
  68. /* 0x016 */    char    eed_scrsize;    /* screen size, in pixels */
  69. #define    MACH_EEPROM_SCR_1152X900    0x00
  70. #define    MACH_EEPROM_SCR_1024X1024    0x12
  71. #define MACH_EEPROM_SCR_1600X1280       0x13    /* new for hi rez */
  72. #define MACH_EEPROM_SCR_1440X1440       0x14
  73. #define MACH_EEPROM_SCR_640X480         0x15
  74.  
  75. /* 0x017 */    char    eed_dogaction;    /* action to take on watchdog reset */
  76. #define    MACH_EEPROM_DOG_MONITOR        0x00    /* return to monitor command level */
  77. #define    MACH_EEPROM_DOG_REBOOT        0x12    /* perform power on reset and reboot */
  78.  
  79. /* 0x018 */    char    eed_defboot;    /* default boot? */
  80. #define    MACH_EEPROM_DEFBOOT        0x00    /* do default boot */
  81. #define    MACH_EEPROM_NODEFBOOT        0x12    /* don't do default boot */
  82.  
  83. /* 0x019 */    char    eed_bootdev[2];    /* name of boot device (e.g. xy, ie) */
  84.  
  85. /* 0x01b */    char    eed_bootctrl;    /* controller number to boot from */
  86. /* 0x01c */    char    eed_bootunit;    /* unit number to boot from */
  87. /* 0x01d */    char    eed_bootpart;    /* partition number to boot from */
  88.  
  89. /* 0x01e */    char    eed_kbdtype;    /* non-Sun keyboard type - for OEM's */
  90. #define    MACH_EEPROM_KBD_SUN    0        /* one of the Sun keyboards */
  91.  
  92. /* 0x01f */    char    eed_console;    /* device to use for console */
  93. #define    MACH_EEPROM_CONS_BW    0x00        /* use b&w monitor for console */
  94. #define    MACH_EEPROM_CONS_TTYA    0x10        /* use tty A port for console */
  95. #define    MACH_EEPROM_CONS_TTYB    0x11        /* use tty B port for console */
  96. #define    MACH_EEPROM_CONS_COLOR    0x12        /* use color monitor for console */
  97. #define MACH_EEPROM_CONS_P4    0x20        /* use the P4 monitor for console */
  98.  
  99. /* 0x020 */    char    eed_showlogo;    /* display Sun logo? */
  100. #define    MACH_EEPROM_LOGO    0x00
  101. #define    MACH_EEPROM_NOLOGO    0x12
  102.  
  103. /* 0x021 */    char    eed_keyclick;    /* keyboard click? */
  104. #define    MACH_EEPROM_NOKEYCLICK    0x00
  105. #define    MACH_EEPROM_KEYCLICK    0x12
  106.  
  107. /* 0x022 */    char    eed_diagdev[2]; /* name of boot device (e.g. xy, ie) */
  108. /* 0x024 */    char    eed_diagctrl;   /* controller number to boot from */
  109. /* 0x025 */    char    eed_diagunit;   /* unit number to boot from */
  110. /* 0x026 */    char    eed_diagpart;   /* partition number to boot from */
  111. /* 0x027 */    char    eed_diagnu;     /* not used */
  112. /* 0x028 */    char    eed_diagpath[40]; /* boot path of diagnostic */
  113. #define MACH_EEPROM_TERM_34x80    00
  114. #define MACH_EEPROM_TERM_48x120 0x12    /* for large scrn size 1600x1280 */
  115. /* 0x050 */     char    eed_colsize;   /* number of columns */
  116. /* 0x051 */     char    eed_rowsize;   /* number of rows */
  117.  
  118. /* 0x052 */    char    eed_nu5[6];    /* not used */
  119.  
  120. /* 0x058 */    struct    eed_tty_def {    /* tty port defaults */
  121.             char    eet_sel_baud;    /* user specifies baud rate */
  122. #define    MACH_EET_DEFBAUD    0x00
  123. #define    MACH_EET_SELBAUD    0x12
  124.             u_char    eet_hi_baud;    /* upper byte of baud rate */
  125.             u_char    eet_lo_baud;    /* lower byte of baud rate */
  126.             u_char    eet_rtsdtr;    /* flag for dtr and rts */
  127. #define MACH_NO_RTSDTR    0x12
  128.             char    eet_unused[4];
  129.         } eed_ttya_def, eed_ttyb_def;
  130. /* 0x068 */    char    eed_banner[80];    /* banner if not displaying Sun logo */
  131.             /* last two chars must be \r\n (XXX - why not \0?) */
  132.  
  133. /* 0x0b8 */    u_short    eed_pattern;    /* test pattern - must contain 0xAA55 */
  134. /* 0x0ba */       short   eed_nu6;        /* not used */
  135. /* 0x0bc */    struct    eed_conf {    /* system configuration, by slot */
  136.             union {
  137.             struct    eec_gen {
  138.                 u_char    eec_type;    /* board type code */
  139.                 char    eec_size[MACH_CONFIG_BYTES-1];
  140.             } eec_gen;
  141.  
  142.             char    conf_byte[MACH_CONFIG_BYTES];
  143.             u_char    eec_type;    /* type of this board */
  144. #define    MACH_SLOT_TYPE_NONE    0            /* no board this slot */
  145. #define    MACH_SLOT_TYPE_CPU    0x01            /* cpu */
  146.             struct    eec_cpu {
  147.                 u_char    eec_type;    /* type of this board */
  148.                 u_char    eec_cpu_memsize; /* MB's on cpu */
  149.                 int    eec_cpu_unused:6;
  150.                 int    eec_cpu_dcp:1;        /* dcp? */
  151.                 int    eec_cpu_68881:1;    /* 68881? */
  152.                 u_char    eec_cpu_cachesize; /* KB's in cache */
  153.             } eec_cpu;
  154.             struct    eec_cpu_alt {
  155.                 u_char    eec_type;    /* type of this board */
  156.                 u_char    memsize;    /* MB's on cpu */
  157.                 u_char    option;        /* option flags */
  158. #define MACH_CPU_HAS_DCP    0x02
  159. #define MACH_CPU_HAS_68881    0x01
  160.                 u_char    cachesize;    /* KB's in cache */
  161.             } eec_cpu_alt;
  162.  
  163. #define    MACH_SLOT_TYPE_MEM    0x02            /* memory board */
  164.             struct    eec_mem {
  165.                 u_char    eec_type;    /* type of this board */
  166.                 u_char    eec_mem_size;    /* MB's on card */
  167.             } eec_mem;
  168.  
  169. #define    MACH_SLOT_TYPE_COLOR    0x03            /* color frame buffer */
  170.             struct    eec_color {
  171.                 u_char    eec_type;    /* type of this board */
  172.                 char    eec_color_type;
  173. #define    MACH_SLOT_COLOR_TYPE_CG2    2    /* cg2 color board */
  174. #define    MACH_SLOT_COLOR_TYPE_CG3    3    /* cg3 color board */
  175.             } eec_color;
  176.  
  177. #define    MACH_SLOT_TYPE_BW    0x04            /* b&w frame buffer */
  178.  
  179. #define    MACH_SLOT_TYPE_FPA    0x05            /* floating point accelerator */
  180.  
  181. #define    MACH_SLOT_TYPE_DISK    0x06            /* SMD disk controller */
  182.             struct    eec_disk {
  183.                 u_char    eec_type;    /* type of this board */
  184.                 char    eec_disk_type;    /* controller type */
  185. #define MACH_SLOT_DISK_TYPE_X450    1
  186. #define MACH_SLOT_DISK_TYPE_X451    2
  187.                 char    eec_disk_ctlr;    /* controller number */
  188.                 char    eec_disk_disks;    /* number of disks */
  189.                 char    eec_disk_cap[4];    /* capacity */
  190. #define MACH_SLOT_DISK_NONE    0
  191. #define MACH_SLOT_DISK_130    1
  192. #define MACH_SLOT_DISK_280    2
  193. #define MACH_SLOT_DISK_380    3
  194. #define MACH_SLOT_DISK_575    4
  195.             } eec_disk;
  196.  
  197. #define    MACH_SLOT_TYPE_TAPE    0x07            /* 1/2" tape controller */
  198.             struct eec_tape {
  199.                 u_char    eec_type;    /* type of this board */
  200.                 char    eec_tape_type;    /* controller type */
  201. #define    MACH_SLOT_TAPE_TYPE_XT    1    /* Xylogics 472 */
  202. #define    MACH_SLOT_TAPE_TYPE_MT    2    /* TapeMaster */
  203.                 char    eec_tape_ctlr;    /* controller number */
  204.                 char    eec_tape_drives;/* number of drives */
  205.             } eec_tape;
  206.  
  207. #define    MACH_SLOT_TYPE_ETHER    0x08        /* Ethernet controller */
  208.  
  209. #define    MACH_SLOT_TYPE_TTY    0x09        /* terminal multiplexer */
  210.             struct eec_tty {
  211.                 u_char    eec_type;    /* type of this board */
  212.                 char    eec_tty_lines;    /* number of lines */
  213. #define MACH_MAX_TTY_LINES    16
  214.                 char    manufacturer;    /* code for maker */
  215. #define MACH_SLOT_TTY_UNKNOWN    0
  216. #define MACH_SLOT_TTY_SYSTECH    1
  217.             } eec_tty;
  218.  
  219. #define    MACH_SLOT_TYPE_GP    0x0a        /* graphics processor/buffer */
  220.  
  221. #define    MACH_SLOT_TYPE_DCP    0x0b        /* DCP ??? XXX */
  222.  
  223. #define    MACH_SLOT_TYPE_SCSI    0x0c        /* SCSI controller */
  224.             struct    eec_scsi {
  225.                 u_char    eec_type;    /* type of this board */
  226.                 char    eec_scsi_type;    /* host adaptor type */
  227. #define MACH_SLOT_SCSI_SUN2    2
  228. #define MACH_SLOT_SCSI_SUN3    3
  229.                 char    eec_scsi_tapes;    /* number of tapes */
  230.                 char    eec_scsi_disks;    /* number of disks */
  231.                 char    eec_scsi_tape_type;
  232. #define MACH_SLOT_SCSI_SYSG    1
  233. #define MACH_SLOT_SCSI_MT02    2
  234.                 char    eec_scsi_disk_type;
  235. #define MACH_SLOT_SCSI_MD21    1
  236. #define MACH_SLOT_SCSI_ADAPT    2
  237.                 char    eec_scsi_driv_code[2];
  238. #define MACH_SLOT_SCSI_D71    1
  239. #define MACH_SLOT_SCSI_D141    2
  240.             } eec_scsi;
  241. #define MACH_SLOT_TYPE_IPC    0x0d
  242.  
  243. #define MACH_SLOT_TYPE_GB    0x0e
  244.  
  245. #define MACH_SLOT_TYPE_SCSI375    0x0f
  246.  
  247. #define MACH_SLOT_TYPE_MAPKIT    0x10
  248.             struct    eec_mapkit {
  249.                 u_char    eec_type;    /* type of this board */
  250.                 char    eec_mapkit_hw;    /* whether INI */
  251. #define MACH_SLOT_TYPE_MAPKIT_INI    1
  252.             } eec_mapkit;
  253.  
  254. #define MACH_SLOT_TYPE_CHANNEL    0x11
  255.  
  256. #define    MACH_SLOT_TYPE_END    0xff            /* end of card cage */
  257.             } eec_un;
  258.         } eed_conf[MACH_MAX_SLOTS+1];
  259. #define MACH_EEPROM_TABLE  0x58         /* 1 indicates alternate key table. */
  260. /* 0x18C */     u_char  which_kbt;      /* which keytable? */
  261. /* 0x18D */     u_char  ee_kb_type;     /* which type for a specific kbrd*/
  262. /* 0x18E */     u_char  ee_kb_id;      /* keyboard id in case of EEPROM table */
  263. /* 0x18F */     u_char  otherlogo;      /* True if eeprom logo  needed */
  264. /* 0x190 */     struct keymap ee_keytab_lc[1];
  265. /* 0x210 */     struct keymap ee_keytab_uc[1];
  266. /* 0x290 */     u_char    ee_logo[64][8];   /* A 64X64 bit space for custom/OEM                                              * designed logo icon */
  267. /* 0x490 */    char    eed_resv[0x500-0x490];    /* reserved */
  268.     } ee_diag;
  269.  
  270.     struct    ee_resv {        /* reserved area of EEPROM */
  271. /* 0x500 */    u_short    eev_wrcnt[3];    /* write count (3 copies) */
  272.         short    eev_nu1;    /* not used */
  273. /* 0x508 */    u_char    eev_chksum[3];    /* reserved area checksum (3 copies) */
  274.         char    eev_nu2;    /* not used */
  275. /* 0x50c */    char    eev_resv[0x600-0x50c];
  276.     } ee_resv;
  277.  
  278.     struct    ee_rom {        /* ROM area of EEPROM */
  279. /* 0x600 */    u_short    eer_wrcnt[3];    /* write count (3 copies) */
  280.         short    eer_nu1;    /* not used */
  281. /* 0x608 */    u_char    eer_chksum[3];    /* ROM area checksum (3 copies) */
  282.         char    eer_nu2;    /* not used */
  283. /* 0x60c */    char    eer_resv[0x700-0x60c];
  284.     } ee_rom;
  285.  
  286.     /*
  287.      * The following area is reserved for software (i.e. UNIX).
  288.      * The actual contents of this area are defined elsewhere.
  289.      */
  290. #ifndef MACH_EE_SOFT_DEFINED
  291.     struct    ee_softresv {        /* software area of EEPROM */
  292. /* 0x700 */    u_short    ees_wrcnt[3];    /* write count (3 copies) */
  293.         short    ees_nu1;    /* not used */
  294. /* 0x708 */    u_char    ees_chksum[3];    /* software area checksum (3 copies) */
  295.         char    ees_nu2;    /* not used */
  296. /* 0x70c */    char    ees_resv[0x800-0x70c];
  297.     } ee_soft;
  298. #else
  299.     struct    ee_soft ee_soft;
  300. #endif
  301. };
  302.  
  303. #define machEepromPtr    ((struct Mach_Eeprom *)MACH_EEPROM_BASE)
  304.  
  305. extern void Mach_EepromPrintConfig _ARGS_((void));
  306. extern void Mach_EepromGetConfig _ARGS_((Mach_CpuConfig *cpuPtr, unsigned int *memSizePtr, Mach_ColorConfig *colorPtr, Mach_FpuConfig *fpuPtr));
  307. extern Boolean Mach_ColorBoardInfo _ARGS_((Mach_ColorConfig *colorPtr));
  308.  
  309.  
  310. #endif !_MACHEEPROM_
  311.  
  312.